<!---
	TEMPLATE: Application.cfm
	AUTHOR: Matt Woodward (mpwoodward@gmail.com)
	DATE: 2/22/2005
	PURPOSE: Application.cfm for CFHibernate test application
	CHANGE HISTORY:
		* 2/22/2005: template created (Matt Woodward)
--->

<cfapplication name="cfhibernate" sessionmanagement="yes" />


<cfparam name="url.reinit" default="1">
<cfscript>
	// initialize the application variables if necessary
	if ((Not StructKeyExists(Application, "inited") OR 
		Not Application.inited) OR 
		(StructKeyExists(url, "reinit") AND url.reinit)) {
		
		// set DSN
		Application.dsn = "cfhibernate";
		
		/* put Hibernate Configuration object in Application scope
			so we don't take this hit every time */
		Application.hibernateConfig = 
			createObject("java", "org.hibernate.cfg.Configuration").configure();
			
		log4jconfig = createObject("java", "org.apache.log4j.PropertyConfigurator");
		//log4jconfig.configure("C:/Documents and Settings/Kurt Wiersma/My Documents/kurtwiersma.com/cfhibernate/src/log4j.properties");
		log4jconfig.configure("/Users/kurt/Projects/DW Sites/kurtwiersma.com/cfhibernate/src/log4j.properties");
		
		// set inited flag
		Application.inited = true;
	}
</cfscript>
